package sng.modules.view.components.city.logic
{
	import as3isolib.display.scene.IsoScene;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import sng.modules.view.components.city.logic.unit.DropAttachment;
	import sng.modules.view.components.city.logic.unit.Tile;
	
	public class AttachmentScene extends IsoScene
	{
		public function AttachmentScene()
		{
			super();
		}
		
		public function addDrop(tile:Tile, col:int, row:int):void
		{
			this.addChild(tile);
			tile.spawnAt(col,row);
		}
		
		public function removeDrop(tile:Tile):void
		{
			if (this.contains(tile))
			{
				this.removeChild(tile);
				tile.dispose();
			}
		}
		
		
		public function setAllDropZoom(zoom:int):void
		{
			var leng:int = this.numChildren;
			for(var i:int=0;i<leng;i++)
			{
				var drop:DropAttachment = this.getChildAt(i) as DropAttachment;
				if(drop==null) continue;
				drop.attachment.scaleX = drop.attachment.scaleY = zoom;
			}
		}

	}
}